/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rpt.lib.relatorio;

import java.awt.Color;
import net.sf.jasperreports.engine.design.JRDesignStyle;
import net.sf.jasperreports.engine.type.HorizontalAlignEnum;
import net.sf.jasperreports.engine.type.VerticalAlignEnum;

/**
 *
 * @author nulce-03
 */
public class CEstiloRelatorio extends JRDesignStyle {

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/
    public static CEstiloRelatorio estilo(
            String aNome,
            String aNomeFonte, int aTamanhoFonte, boolean aBold,
            final HorizontalAlignEnum aHorizontalAlignEnum,
            final VerticalAlignEnum aVerticalAlignEnum,
            Color aCorFrente, Color aCorFundo,
            String aNomeFontePdf, String aPdfEncoding, boolean aPdfEmbedded,
            boolean aBrancoSendoNulo) {
        //
        CEstiloRelatorio ds = new CEstiloRelatorio();
        ds.setName(aNome);
        ds.setBold(aBold);
        ds.setDefault(true);
        ds.setForecolor(aCorFrente);
        ds.setBackcolor(aCorFundo);
        ds.setFontName(aNomeFonte);
        ds.setFontSize(aTamanhoFonte);
        ds.setHorizontalAlignment(aHorizontalAlignEnum);
        ds.setVerticalAlignment(aVerticalAlignEnum);
        ds.setPdfFontName(aNomeFontePdf);
        ds.setPdfEncoding(aPdfEncoding);
        ds.setPdfEmbedded(aPdfEmbedded);
/*
        try {
            addStyle(ds);
        } catch (JRException ex) {
            Logger.getLogger(CRelatorioJasperAncestral.class.getName()).log(Level.SEVERE, null, ex);
        }
*/
        ds.setBlankWhenNull(aBrancoSendoNulo);
        return ds;
    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/
    public static CEstiloRelatorio estilo(
            String aNome,
            String aNomeFonte, int aTamanhoFonte, boolean aBold,
            Color aCorFrente, Color aCorFundo,
            String aNomeFontePdf, String aPdfEncoding, boolean aPdfEmbedded,
            boolean aBrancoSendoNulo) {
        //
        return estilo(aNome, aNomeFonte, aTamanhoFonte, aBold,
                HorizontalAlignEnum.LEFT,
                VerticalAlignEnum.TOP,
                aCorFrente, aCorFundo, aNomeFontePdf, aPdfEncoding, aPdfEmbedded, aBrancoSendoNulo);
    }
}
